* Creates results for Table A2

clear all

use "$savedata/masterdata.dta", replace

keep if sample25==1
gen vol = vol25

* Create indicator for a doctor in their first year
gen new = 0
replace new = 1 if firstyear==finyear

reghdfe survive30 c.prevyear_cost std_ami3 std_nonami3, absorb(i.sex##i.derv_age i.black i.mixed i.chinese i.asian i.race_miss i.ynch* i.prevyear_stroke i.di1 i.di2 i.di3 i.di4 i.di5 i.shock i.arythmia i.arthero i.arrest i.dow##i.admidate_mont##i.finyear i.hyid i.doctor_id, savefe) vce(cluster doctor_id) keepsingletons
eststo model1
esttab model1 using "$results/TableA2.xls", replace keep(std_ami3 std_nonami3) b se

reghdfe survive365 c.prevyear_cost std_ami3 std_nonami3, absorb(i.sex##i.derv_age i.black i.mixed i.chinese i.asian i.race_miss i.ynch* i.prevyear_stroke i.di1 i.di2 i.di3 i.di4 i.di5 i.shock i.arythmia i.arthero i.arrest i.dow##i.admidate_mont##i.finyear i.hyid i.doctor_id, savefe) vce(cluster doctor_id) keepsingletons
eststo model2
esttab model2 using "$results/TableA2.xls", append keep(std_ami3 std_nonami3) b se

reghdfe survive30 c.prevyear_cost i.new, absorb(i.sex##i.derv_age i.black i.mixed i.chinese i.asian i.race_miss i.ynch* i.prevyear_stroke i.di1 i.di2 i.di3 i.di4 i.di5 i.shock i.arythmia i.arthero i.arrest i.dow##i.admidate_mont##i.finyear i.hyid i.doctor_id, savefe) vce(cluster doctor_id) keepsingletons
eststo model3
esttab model3 using "$results/TableA2.xls", append keep(1.new) b se

reghdfe survive365 c.prevyear_cost i.new, absorb(i.sex##i.derv_age i.black i.mixed i.chinese i.asian i.race_miss i.ynch* i.prevyear_stroke i.di1 i.di2 i.di3 i.di4 i.di5 i.shock i.arythmia i.arthero i.arrest i.dow##i.admidate_mont##i.finyear i.hyid i.doctor_id, savefe) vce(cluster doctor_id) keepsingletons
eststo model4
esttab model4 using "$results/TableA2.xls", append keep(1.new) b se

